
SET( LUA_MPI_H config.h luaMPI.h
			)
SET( LUA_MPI_SRC ./LUA/luaMPI.cpp
                 ./src/luaMPI.cpp
                 ./src/luaMPIUI.cpp
                 )


INCLUDE_DIRECTORIES(  ${LUAEx_SOURCE_DIR} )
INCLUDE_DIRECTORIES(  ${LUA_INCLUDE_DIR} )
INCLUDE_DIRECTORIES(  ${SOL2_INCLUDE_DIR} )
INCLUDE_DIRECTORIES(  ${Boost_INCLUDE_DIR} )
INCLUDE_DIRECTORIES(  ${MPI_C_INCLUDE_PATH} )
message( STATUS "PARSERS boost:${Boost_INCLUDE_DIR}")

#SOURCE_GROUP(LUA FILES ${LUA_MPI_H} ${LUA_MPI_SRC})
set(LUA_MPI_ALLFILES ${LUA_MPI_H} ${LUA_MPI_SRC})

if(LUA_MPI_STATIC_LIB)
	ADD_LIBRARY(luaMPI STATIC ${LUA_MPI_ALLFILES})
else(LUA_MPI_STATIC_LIB)
	ADD_LIBRARY(luaMPI SHARED ${LUA_MPI_ALLFILES})
    if(WIN32)
        add_definitions( -DLUA_MPI_DLL )
    endif(WIN32)
endif(LUA_MPI_STATIC_LIB)


add_definitions(-DUNICODE -D_UNICODE)

target_link_libraries(luaMPI ${LUA_LIBRARY} )
target_link_libraries(luaMPI ${Boost_MPI_LIBRARY} ${Boost_SERIALIZATION_LIBRARY})
target_link_libraries(luaMPI ${MPI_LIBRARY})
target_link_libraries(luaMPI ${MPI_LIBRARIES})

SET_TARGET_PROPERTIES(luaMPI PROPERTIES PREFIX "")
collect_library(luaMPI)
